<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>举报信息列表</title>
<style type="text/css">
		a{
				text-decoration: "none";
		}
		a:hover{
				font-size: "20px";
				font-size: "bold";
				color:"#f9f";
		}
</style>
<style type="text/css">
		table{
				table-layout: "fixed";
		}
		td{
				word-break:"break-all"; 
		}
</style>
<script type="text/javascript" src="public/script/jquery-1.6.4.min.js"></script>
<script type="text/javascript" src="public/script/jquery-tools-1.2.7.min.js"></script>
<script type="text/javascript">
$(function(){
		$('a[rel]').overlay({
			onBeforeLoad:function(){
					var detail = this.getOverlay().find('.content');
					var hv="check_"+$("input[id="+this.getTrigger().attr("id")+"]").val();
					$.getJSON(hv,function(data){
						detail.html(data["returnMsg"]);
					});
					var bat="#bat_"+this.getTrigger().attr("id");
					var bdt="#bdt_"+this.getTrigger().attr("id");
					$(bat).removeAttr("disabled");
					$(bdt).removeAttr("disabled");
			}			
		});	
});
function checkAN(id,ck){
	 $.ajax({
		   type: "GET",
		   url: "check_checkAN.action",
		   data: "tempId="+id+"&view="+ck,
		   success: function(data){
		     alert(data["returnMsg"]);
		   },
		   error:function(){
			   alert("网络故障！请稍后再尝试！");
		   }
		}); 
}
</script>
</head>
<body><center>
		<table border="1" bordercolor="black" style="border-collapse:collapse;" width="100%">
		<thead>
				<th>序号</th>
			<th>举报时间</th>
			<th>举报内容</th>
		</thead>
		<tbody>
				<s:iterator value="#data" var="d" status="st">
						<tr align="center" id="tr<s:property value="#st.index"/>">
							<td width="40">
							<s:property value="#st.index+1"/>
							</td>
							<td width="160">
							<s:property value="#d.noticeDate.toString().substring(0,16)"/>
							</td>
							<td>
							<a rel="#overlay" href="#" id="hv<s:property value="#st.index"/>">查看详细信息！</a>
							<input type="hidden" id="hv<s:property value="#st.index"/>" value="${d.noticeContent}"/>
							<p style="float:right;margin-bottom: 0px;"><button disabled id="bat_hv<s:property value="#st.index"/>" onclick="checkAN(<s:property value="#d.noticeId"/>,true);this.style.color='green';">内容合格，公开此内容！</button><button disabled id="bdt_hv<s:property value="#st.index"/>" onclick="checkAN(<s:property value="#d.noticeId"/>,false);this.style.color='red';">内容不合格，隐藏此内容！</button></p>
							</td>
						</tr>
				</s:iterator>
			</tbody>
		</table>
		</center>
		<ul type="none">
		<s:if test="#page.prePage">
				<li style="float:left;"><a href="<s:property value="#page.pageURL"/><s:property value="#page.currentPage-1"/>">上一页&nbsp;&nbsp;</a></li>
		</s:if>
	<s:iterator value="#page.fontPages" var="pn">
				<s:if test="#pn==#page.currentPage">
					<li style="float:left;"><b><s:property value="#pn"/></b>&nbsp;&nbsp;</li>
				</s:if><s:else>
					<li style="float:left;"><a href="<s:property value="#page.pageURL"/><s:property value="#pn"/>"><b><s:property value="#pn"/></b>&nbsp;&nbsp;</a></li>
				</s:else>
	</s:iterator>
	<s:if test="#page.nextPage">
				<li style="float:left;"><a href="<s:property value="#page.pageURL"/><s:property value="#page.currentPage+1"/>">下一页&nbsp;&nbsp;</a></li>
	</s:if>
	<li style="float:left;"><b>总页数：<s:property value="#page.allPages"/></b></li>
	</ul>
<div id="overlay" style="border:1px solid;background-color:#fff;z-index:1000;display:none;width:98%;height:100%;left:0px;">
			<div class="close" style="float:left;"><img src="public/image/close.png"/></div>
			<br><br>
			<div class="content"></div>
</div>
</body>
</html>